<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>{{.title}}</title>
    <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">
    <style>
        body {
            background-color: #444444;
        }

        .login-container {
            background-color: #fff;
            border-radius: 4px;
            height: 250px;
            left: 50%;
            margin-left: -220px;
            margin-top: -140px;
            padding: 35px 40px 50px;
            position: absolute;
            top: 50%;
            width: 360px;
        }

        .login-element {
            margin: 0;
            padding: 0;
        }

        .title {
            text-align: center;
            font-size: 26px;
            color: #444;
            height: 40px;
            margin-bottom: 40px;
            overflow: hidden;
        }

        .input-container {
            height: 42px;
            margin-bottom: 20px;
            line-height: 42px;
        }
    </style>
</head>
<body>
<div class="login-container">
    <div class="login-element">
        <form class="layui-form" method="post" action="/admin/loginPost">
            <p class="title">{{ .title }}</p>
            <div class="input-container">
                <input type="text" name="username" required lay-verify="required" placeholder="请输入帐号" autocomplete="off" class="layui-input">
            </div>
            <div class="input-container">
                <input type="password" name="password" required lay-verify="required" placeholder="请输入密码"  autocomplete="off" class="layui-input">
            </div>
            <button lay-submit lay-filter="go" class="layui-btn layui-btn-fluid">登录</button>
        </form>
    </div>
</div>

<script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script>
<script>
    //JavaScript代码区域
    layui.use(['jquery','layer','form'], function(){
        var $ = layui.jquery;
        var form = layui.form;
        var layer = layui.layer;
        // 登录错误提示变量
        var loginErrMsg = {{ .loginErrMsg }};
        $(function (){
            // 判断如果在子iframe里面就把顶层iframe给刷新了
            if (window.self != window.top) {
                parent.window.location.href = location.href;
            }
            // 登录错误提示
            if (loginErrMsg) {
                layer.msg(loginErrMsg, {icon: 2, time: 1500})
            }
        })



    });
</script>
</body>
</html>